-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGridPro] Add doc example for tree data children lazy loading #3657
[DataGridPro] Add doc example for tree data children lazy loading #3657
Conversation
These are the results for the performance tests:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👍
Just a small suggestion.
Co-authored-by: José Rodolfo Freitas <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
You could add one or two sentences before the demo to say:
- we add a property
descendantCount
to rows, to know which group cell can be extended - we override both
<GouppingCell />
andhandleRowExpansionChange
to take this new property into account
I should simplify the reading, but I'm not sure it is needed
|
||
const GroupingCellWithLazyLoading = (props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already a complex component. Could add a comment to say that it is not the main one, and explain briefly what it does. For example
This component override the Grouping cell to show the expand/collapse icon according to the descendantCount
property instead of the descendants
property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
React.useEffect(() => { | ||
fakeDataFetcher().then(setRows); | ||
|
||
const handleRowExpansionChange = async (node) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By curiosity, why putting it in a useEffect
instead of a useCallback
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This useEffect
is only called once to initialize the event listeners and init the top level rows.
Part of #3377
Doc preview